<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
    <script>
        document.body.style.background = bgColor();
        function bgColor () {
            var str = ''
            for(var i = 0 ; i < 6;i++){
                var num = parseInt(Math.random() * 17).toString(16)
                if( num == 10){
                    num = parseInt(Math.random() * 10)
                }
                str += num
            }
           
            return '#' + str
            
        }
        
        
        setInterval(function(){
            document.body.style.background = bgColor();
        },1000)
        
    </script>

</body>
</html>